package com.fingard.dsp.core;

import com.fingard.dsp.entity.po.EncodeSaltValuePO;
import lombok.Data;

import java.util.*;

/**
 * 储存DSP安全相关的配置数据,例如IP白名单和加解密盐值
 * @author Parker on 2020-08-05.
 * @version 1.0
 */
@Data
public class DSPSecurityData {
    //是否从文件读取安全配置
    private boolean readFileFlag = false;

    private DSPSecurityData(){}
    //租户IP白名单
    private Map<String, List<String>> ipWhiteList = new HashMap<>();
    //所有租户
    private Set<String> tenantIdSet = new HashSet<>();
    //租户盐值
    private Map<String, List<EncodeSaltValuePO>> encodeSaltValues = new HashMap<>();

    private static class singleDSPSecurityDataHolder{
        private static final DSPSecurityData INSTANCE = new DSPSecurityData();
    }
    public static final DSPSecurityData getInstance(){
        return singleDSPSecurityDataHolder.INSTANCE;
    }
}
